/*
 *  登录
 *
 */
import { getRequest, postRequest, getCapt, postEncryptRequest } from '/src/lib/axios';

export const loginApi = {
  /**
   * 登录 @author 卓大
   */
  login: (param) => {
    return postRequest('security/login', param);
  },

  /**
   * 退出登录 @author 卓大
   */
  logout: () => {
    return postRequest('security/logout');
  },

  /**
   * 获取验证码 /security/identifyImage?uuid=111
   *
   * /foundation/blprojectattach/upload?${folder}
   */
  getCaptcha: (id) => {
    return getCapt(`/security/identifyImage?${id}`);
  },

  /**
   * 获取登录信息 @author 卓大
   */
  getLoginInfo: () => {
    return getRequest('/security/getLoginInfo');
  },
  // 修改个人信息  /foundation/blsysuser/update
  updateinfo: (param) => {
    return postRequest('/foundation/blsysuser/update', param);
  },
  // 修改密码  /foundation/blsysuser/EditPassword
  updatePassword: (param) => {
    return postRequest('/foundation/blsysuser/EditPassword', param);
  },

  // 获取 登录条件   /captcha/generate-captcha-info
  getLogin: () => {
    return getRequest('/captcha/generate-captcha-info');
  },
};
